<!DOCTYPE html>
<html   xmlns="http://www.w3c.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:p="http://primefaces.org/ui"
        xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head/>
    <h:body>
        <h:outputText value="Does not work properly..."/>
        <h:form> 
            <p:growl id="growl" />

            <p:panel id="pnl" header="New User" style="margin-top:10px">
                <p:messages id="messages" />
                <h:panelGrid columns="3" id="grid" cellpadding="5">
                    <p:outputLabel for="username" value="Username" />
                    <p:inputText id="username" value="#{spotlightBean.username}" required="true">
                        <f:validateLength minimum="2" />
                    </p:inputText>
                    <p:message for="username" />

                    <p:outputLabel for="email" value="Surname:" />
                    <p:inputText id="email" value="#{spotlightBean.email}" required="true"/>
                    <p:message for="email" />
                </h:panelGrid>

                <p:commandButton value="Save" icon="ui-icon-check" actionListener="#{spotlightBean.save}" update="growl grid" oncomplete="handleForm(xhr, status, args)"/>
            </p:panel>

            <p:spotlight target="pnl" widgetVar="spot"/>
        </h:form>
    </h:body>
</html>
